package me.loque.servlets;

import java.util.logging.Logger;
import javax.servlet.http.HttpServlet;
import me.loque.Messages;
import org.jabsorb.JSONRPCBridge;

/**
 * Registers the JSON-RPC classes.
 * <P/>
 * Created on 25 Sep 2009, at 08:43:09.
 * Project: LoQueMe.
 * Filename: RegisterJSONRPC.java.
 * &copy; Copyright <A href="http://www.loque.me">LoQueMe</A> 25 Sep 2009
 * 
 * @author joel
 */
@SuppressWarnings("serial")
public class RegisterJSONRPC extends HttpServlet
{
    /**
     * Logging object.
     */
    private static final Logger LOGGER = Logger.getLogger(RegisterJSONRPC.class.getName());
    
    /**
     * {@inheritDoc}
     */
    @Override
    public void init()
    {
        try
        {
            JSONRPCBridge.getGlobalBridge().registerClass("Messages", Messages.class);
        }
        catch (Exception e)
        {
            LOGGER.severe("Unable to register a class in the JSON-RPC global bridge.\n" + e.getMessage());
        } 
    }
}
